// $Id: CharacterSheet.java 13 2009-02-24 12:33:10Z joakim.waltersson $
package se.waltersson.wowarmory.page;

import javax.xml.xpath.XPathExpressionException;

/**
 * @author Joakim Waltersson
 * @version $Revision: 13 $ $Date: 2009-02-24 12:33:10 +0000 (Tue, 24 Feb 2009) $
 */
public class CharacterSheet extends ArmoryPage {
    private static final String pageName = "character-sheet.xml";
    private String charClass;
    private long level;
    private String race;
    private String name;

    public CharacterSheet(String realm, String charName) {
        super(realm, charName);
        this.name = charName;
    }


    /* (non-Javadoc)
     * @see se.waltersson.wowarmory.ArmoryPage#getPath()
     */
    public String getQuery() {
        return pageName + getQueryParameters();
    }

    protected void parse() {
        try {
            charClass = getValue("/page/characterInfo/character/@class");
            level = getNumber("/page/characterInfo/character/@level");
            race = getValue("/page/characterInfo/character/@race");
        } catch (XPathExpressionException e) {
            e.printStackTrace();
        }
    }


    public String getCharClass() {
        return charClass;
    }


    public long getCharLevel() {
        return level;
    }


    public String getRace() {
        return race;
    }


    public String getName() {
        return name;
    }
    
}
